<cfsetting enablecfoutputonly="Yes">

<!--- 
  /**
   * @author  <info@mireau.net>
   * @version 1.0 - <yyyy/mm/dd>
   */
--->

<cfscript>
  /**
   * Splits a string according to a char.
   *
   * @author   rens@joxx.nl
   * @version  1.0 - 2003.04.02
   */
  function splitString( str, splitchar )
  {
    var _xResults = arrayNew( 1 );
    var _nChar    = ' ';
    var _nSubStr  = "";
  
    str = trim( str );
  
    for( i = 1; i lte len( str ); i = i + 1 )
    {
      _nChar = mid( str, i, 1 );
  
      if( _nChar eq splitchar )
      {
        _xResults[arrayLen( _xResults ) + 1] = _nSubStr;
        _nSubStr = "";
        
        if( i eq len( str ))
        {
          _xResults[arrayLen( _xResults ) + 1] = _nSubStr;
        }
      }
      else if( i eq len( str ))
      {
        _xResults[arrayLen( _xResults ) + 1] = _nSubStr & _nChar;
      }
      else
      {
        _nSubStr = _nSubStr & _nChar;
      }
    }
    
    return( _xResults );
  }
  
  /* Copy to a scope where it's visible from everywhere */
  request.udf.splitString = splitString;
</cfscript>

<cfsetting enablecfoutputonly="No">